package com.aimee.dao;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.List;

import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.ResultSetHandler;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;

import com.aimee.entity.Page;
import com.aimee.util.Dbutil;

public class PageDAO {
	// 根据pageid 得到页面权限
  public List getRolePages(String ids) throws SQLException {
	  Connection conn = Dbutil.getConn();
		QueryRunner runner = new QueryRunner();
		String sql = "SELECT * from Page where page_id in("+ ids+ ")";
		List list = runner.query(conn, sql, new BeanListHandler<Page>(Page.class));
		conn.close();
		return list;
  }
}
